package cn.news.xinhuanet.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 常量
 * @author xinhua
 *
 */
public class HomeConstants {

	public static final String yyyyMMddHHmmssS="yyyy-MM-dd HH:mm:ss.S";
	public static final String yyyyMMddHHmmss="yyyy-MM-dd HH:mm:ss";
	public static final String yyyyMMdd="yyyy-MM-dd";
	public static final String yyyy年MM月dd日="yyyy年MM月dd日";
	public static final int pagesize = 20;
	public static final String HOME_RESULT_CODE="key";
	public static final String HOME_RESULT_MSG="value";
	public static final String HOME_COOKIE_ID="HOMEID";
	public static final String HOME_SESSION_ID="SESSIONID";

	public static final String HOME_AUTO_ID="HOME_ATD";//自动登录标识
	public static final String HOME_AUTO_NICKNAME="HOME_NICKNAME";//自动登录标识
	public static final String HOME_AUTO_PWD="HOME_ATP";//自动登录标识
	public static final int year_for_seconds= 1*60*60*24*365;//一年
	public static final int month_for_seconds= 1*60*60*24*30;//一月
	public static final int senven_days_for_seconds= 1*60*60*24*7;//一周
	public static final int one_minutes_for_seconds= 1*60*1;//一分钟
	public static final int five_minutes_for_seconds= 1*60*5;//5分钟
	public static final int thirty_minutes_for_seconds= 1*60*30;//30分钟
	public static final String separator="/";

	public static String encoding = "UTF-8";

	public static String WEIBO="weibo";
	public static String WEIXIN="weixin";
	public static String QQ="qq";

	public static String WEIBO_APP_KEY = "Weibo_App_Key";
	public static String WEIBO_APP_SERCET = "Weibo_App_Sercet";
	public static String WEIBO_REDIRECT_URI = "Weibo_Redirect_Uri";
	public static String WEIBO_ACCESS_TOKEN = "Weibo_Access_Token";
	public static String WEIBO_AUTHORIZE_URL = "Weibo_Authorize_Url";
	public static String WEIBO_USERINFO_SHOW = "Weibo_UserInfo_Show";


	public static final Pattern nickname_pattern =Pattern.compile("[a-zA-Z0-9\u4e00-\u9fa5_]{1,20}");;//昵称.允许中英文，数字，下划线;长度6~20
	public static final Pattern email_pattern=Pattern.compile("([a-z0-9]*[-_]?[a-z0-9]*)+@([a-z0-9]*[-_]?[a-z0-9]*)+[\\.][a-z]{2,3}([\\.][a-z]{2})?$");;//
	public static final Pattern password_pattern=Pattern.compile("[a-zA-Z0-9_]{6,18}");;//允许英文，数字，下划线;长度6~18
	public static final Pattern at_pattern = Pattern.compile("@([^@\\s:,;：]{1,})([\\s:,;：]{0,1})");//@.+?[\\s:]
	public static final Pattern phone_pattern=Pattern.compile("1[\\d]{10}");//匹配手机
	public static final Pattern emotion_pattern=Pattern.compile("1[\\d]{10}");//匹配手机
	public static final Pattern number_pattern=Pattern.compile("[\\d]+");//匹配数字
	public static final Pattern topic_pattern=Pattern.compile("#([^#]{1,})(#{1})");//匹配话题


	public static String page_nauthorized = "/global/error/unauthorized.jsp";
	public static String page_500 = "/global/error/500.jsp";


	public static final String Keywords = "志愿者,志愿者网,公益网站,服务队,志愿者服务队,志愿活动,公益活动,公益访谈,交流分享,支教下乡,环境保护,动物保护,文明礼仪,志愿者之家,发布活动,招募,抗震救灾,公益社区";
	public static final String Description = "志愿者之家(www.125home.cn) 是一个志愿者交流、分享平台，为志愿者、公益组织和慈善机构提供发现、参与和策划志愿活动，交流分享志愿服务经历和心得的平台。奉献、友爱、互助、进步";

	public static void main(String[] args) {
		String text="##测试# 多撒#测试# 多撒#测试### 多撒?#";
		Matcher m = HomeConstants.topic_pattern.matcher(text);
		while (m.find()) {
			String atnk = m.group();
			System.out.println("topic:"+atnk.trim());
		}
	}
	
}
